/*
 * @Author: scopesang
 * @Date: 2022-05-10 16:26:51
 * @LastEditors: scopesang
 * @LastEditTime: 2022-05-10 18:13:45
 * @FilePath: \hook-ts\src\components\Comp1.tsx
 * @Description: 函数式组件
 * 
 * Copyright (c) 2022 by scopesang/大鹏科技, All Rights Reserved. 
 */

// 其实不写React.FC也可以。React.FC表示：React.Function Component。React.FC 显式地定义了返回类型，其他方式是隐式推导的
import React from 'react'
// 使用IProps接口定义字段类型
interface Iprops {
    num: number
}
const Comp1 = (props: Iprops) => {

    return (
        <>
            <h3>{props.num}</h3>
            <button>累加</button>
        </>
    )
}
export default Comp1;